import baseUrl from '@/api/env.js'
export default {
    /**
     * 微信内部登录
     */
    wxlogin() {
        return new Promise((resolve, reject) => {
            uni.login({
                provider: 'weixin',
                success: function (loginRes) {
                    resolve(loginRes.code)
                },
                fail: function (err) {
                    reject(err)
                }
            })
        })
    },

    /**微信登录
     * @param {Object} form
     */
    async login() {
        let code= await this.wxlogin();
        return  baseUrl+`/system/wechat/weChatData?code=${code}`;
    },

    wechatModeDeal: baseUrl + '/system/wechat/wechatModeDeal',


    setUserOpenId: baseUrl + '/system/wechat/setUserOpenId'

}